Skip to main content

Get Widget Configuration

Used to retrieve the configuration settings for a specific chat widget. This endpoint provides all the necessary settings to render and customize the chat widget interface.

API Endpoint

PropertyValue
Request MethodGET
Request URLhttps://api.seliseblocks.com/conversation/config

Request

Request Example

curl -X GET 'https://api.seliseblocks.com/conversation/config?widget_id=widget_123' \
-H 'accept: application/json'

Query Parameters

FieldTypeRequiredDescription
widget_idstringYesThe unique identifier of the chat widget.

Request Headers

FieldTypeRequiredDescription
acceptstringYesAccepted response format. Use application/json
tip

When to use this endpoint:

  • Widget initialization: Fetch configuration before rendering the chat interface
  • Dynamic customization: Apply branding and styling based on configuration
  • Feature toggling: Enable/disable features based on widget settings
  • Multi-tenant support: Load different configurations for different clients
  • A/B testing: Serve different widget variants based on configuration
  • Real-time updates: Periodically refresh configuration for dynamic changes

Common use cases:

  • Branding: Colors, logos, fonts, and theme customization
  • Behavior: Auto-greeting messages, response delays, typing indicators
  • Features: File upload, voice input, quick replies, suggested actions
  • Integration: Third-party tools, analytics, CRM connections
  • Localization: Language settings, date/time formats, translations
  • Access control: Authentication requirements, user permissions

Response

Success Response (200 OK)

Returns a configuration object containing all widget settings.

{
"widget_id": "widget_123",
"display_name": "Customer Support Chat",
"theme": {
"primary_color": "#007bff",
"secondary_color": "#6c757d",
"background_color": "#ffffff",
"text_color": "#212529",
"font_family": "Inter, sans-serif"
},
"branding": {
"logo_url": "https://example.com/logo.png",
"company_name": "Acme Corp",
"avatar_url": "https://example.com/avatar.png"
},
"behavior": {
"welcome_message": "Hello! How can I help you today?",
"auto_open": false,
"auto_open_delay": 3000,
"show_typing_indicator": true,
"message_delay": 500,
"enable_sound": true
},
"features": {
"file_upload": true,
"voice_input": false,
"quick_replies": true,
"suggested_actions": true,
"conversation_history": true,
"export_transcript": true,
"rating_prompt": true
},
"limits": {
"max_file_size_mb": 10,
"max_message_length": 2000,
"allowed_file_types": ["pdf", "jpg", "png", "docx"]
},
"localization": {
"language": "en",
"timezone": "UTC",
"date_format": "MM/DD/YYYY",
"time_format": "12h"
},
"integration": {
"analytics_enabled": true,
"analytics_id": "GA-123456",
"crm_integration": "salesforce",
"custom_metadata": {
"department": "support",
"priority": "high"
}
},
"security": {
"require_authentication": false,
"allowed_domains": ["example.com", "*.example.com"],
"data_retention_days": 90
}
}

Response Fields

FieldTypeDescription
-objectFlexible configuration object (additionalProp1: {}) containing widget settings. The structure varies based on widget type and customization options.
note

Configuration Object Structure

The response returns a flexible object that can contain various configuration categories:

Theme Settings:

  • Color schemes (primary, secondary, background, text)
  • Typography (font families, sizes, weights)
  • Layout preferences (position, size, animations)
  • Dark/light mode support

Branding Elements:

  • Company logo and avatar URLs
  • Brand colors and styling
  • Custom CSS overrides
  • White-label options

Behavior Configuration:

  • Welcome and greeting messages
  • Auto-open settings and delays
  • Typing indicators and animations
  • Sound effects and notifications
  • Message delivery settings

Feature Flags:

  • File upload capabilities
  • Voice and video support
  • Quick reply buttons
  • Suggested actions
  • Conversation history
  • Transcript export
  • Feedback and rating prompts

Limits and Constraints:

  • Maximum file sizes
  • Message length limits
  • Rate limiting settings
  • Allowed file types
  • Concurrent session limits

Localization:

  • Language and locale
  • Timezone settings
  • Date and time formats
  • Currency formatting
  • Translation keys

Integration Settings:

  • Analytics tracking (Google Analytics, Mixpanel, etc.)
  • CRM connections (Salesforce, HubSpot, etc.)
  • Third-party webhooks
  • Custom metadata fields
  • API keys for external services

Security and Compliance:

  • Authentication requirements
  • Domain whitelist/blacklist
  • Data retention policies
  • GDPR compliance settings
  • Encryption preferences

Error Response (422 Unprocessable Entity)

Returns validation error details when the widget_id is invalid or not found.

{
"detail": [
{
"loc": [
"query",
"widget_id"
],
"msg": "Widget not found or access denied",
"type": "value_error.notfound"
}
]
}

Error Response Fields

FieldTypeDescription
detailarrayArray of validation error objects.
locarrayLocation of the error in the request (e.g., query parameter).
msgstringHuman-readable error message.
typestringError type identifier.

Common Error Scenarios

Error TypeDescriptionResolution
Widget Not FoundThe specified widget_id doesn't existVerify widget_id is correct and widget exists
Access DeniedInsufficient permissions to access widget configCheck API credentials and permissions
Widget InactiveThe widget has been deactivated or deletedContact administrator or use an active widget
Invalid Widget IDWidget ID format is incorrectEnsure widget_id follows correct format
Configuration UnavailableWidget config temporarily unavailableRetry with exponential backoff

Error Codes

Status CodeDescriptionResponse Type
200OK - Configuration retrieved successfullySuccess
400Bad Request - Invalid request formatBad Request
401Unauthorized - Authentication requiredUnauthorized
403Forbidden - Access denied to widget configForbidden
404Not Found - Widget doesn't existNot Found
422Validation Error - Invalid widget_idUnprocessable Entity
500Internal Server Error - Failed to fetch configInternal Server Error
warning

Important Considerations

  • Caching: Cache configuration locally to reduce API calls and improve performance
  • Cache invalidation: Implement cache refresh strategy (e.g., every 5-15 minutes)
  • Fallback values: Always have default configuration in case API fails
  • Security: Don't expose sensitive configuration values in client-side code
  • Version compatibility: Configuration structure may evolve; handle unknown fields gracefully
  • Performance: Fetch configuration once during initialization, not per message
  • Real-time updates: Consider WebSocket or polling for dynamic configuration changes
  • Cross-origin: Ensure proper CORS configuration for widget embedding
  • Feature detection: Check feature flags before enabling functionality
  • Responsive design: Adapt widget rendering based on configuration settings
  • Error handling: Gracefully degrade if specific configuration options are missing
  • Testing: Test widget with different configurations across environments